import request from "@/utils/request";

export function getChannelsList(){
    return request({
        url: '/channels',
        method: 'get',
    })
}

export function addArticleApi(data) {
    return request({
        url: '/mp/articles?draft=false',
        method: 'post',
        data
    })
}

export function editArticleApi(data){
    return request({
        url: `/mp/articles/${data.id}?draft=false`,
        method: 'put',
        data
    })
}

export function getArticleApi(params) {
    return request({
        url: '/mp/articles',
        method: 'get',
        params
    })
}

export function getArticleByIdApi(id) {
    return request({
        url: `/mp/articles/${id}`,
        method: 'get',
    })
}

export function deleteArticleApi(id) {
    return request({
        url: `/mp/articles/${id}`,
        method: 'delete',
    })
}